ibd: unified peer byte-rate EWMA - #308
Merged
Merged
Conversation
Integer per-peer rate accrued only while getdata is in flight. Idle rebaseline freezes the EWMA; stall is now - max(rx, work start). Co-authored-by: Cursor <cursoragent@cursor.com>
Stall clocks stay on the event path; the reader only fetch_adds ciphertext/plaintext progress into bytes_rx_total for the EWMA. Co-authored-by: Cursor <cursoragent@cursor.com>
Tip-hole peer order and AddrMan note_speed on death use the inflight EWMA instead of lifetime complete-block speed_sample. Co-authored-by: Cursor <cursoragent@cursor.com>
Issuing getdata only starts the 30s grace clock. Qualifying stream or block/notfound events count as progress; hung sockets disconnect. Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the 2MiB payload floor and 60s-since-first-byte gate. Pack warmup is still 60s since first block payload. Co-authored-by: Cursor <cursoragent@cursor.com>
Drop one no-rx or relative-slow hole owner instead of clearing the whole race set at 6s. Steal hung densify only when a faster peer has a slot; issue new densify by EWMA rank; skip the band walk at cap; give 16 slots only to 2×-median outliers. Co-authored-by: Cursor <cursoragent@cursor.com>
PeerRate is the only rate and stall clock. first_data_ms stays a plain u64 for AddrMan latency and relative-slow pack warmup. Co-authored-by: Cursor <cursoragent@cursor.com>
Operator stall/relative-slow text and ibd-memory densify slots now match the single inflight EWMA; PeerRate rustdoc names the consumers. Co-authored-by: Cursor <cursoragent@cursor.com>
4 tasks
Clippy denies dead_code on lib targets; ranking is rank_peers_by_speed for both tip-hole cover and densify issue. Co-authored-by: Cursor <cursoragent@cursor.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bps().PeerRateinstead of a complete-block window plus a second rx clock. Getdata issue is not rx; a uniformly slow local pipe is allowed to finish the current frame.Test plan
cargo test -p rbitcoin-net --lib rate::cargo test -p rbitcoin-net --lib relative_slow/disconnect_stalled/cover_tip_holes/densify_Made with Cursor